
function createPonTables(){
	createPonCaseBasicInfo();
	createPonCaseBasicInfoCl();
}
/**
 * 创建案件登记表
 * @param callback
 */
function createPonCaseBasicInfo(callback){
	if(pdb){
		pdb.transaction(
			function(tx) {
			    tx.executeSql(
			            "CREATE TABLE IF NOT EXISTS CASE_BASICINFO(" +
			            "CASE_BASICINFO_ID INTEGER primary key AutoIncrement," +
			            "CREATE_ID VARCHAR(100)," +
			            "CREATE_NAME varchar(255)," +
			            "CREATE_TIME DATETIME ," +
			            "MODIFY_ID VARCHAR(100)," +
			            "MODIFY_TIME DATETIME ," +
			            "NOTE VARCHAR(4000),"+
			            "BILL_ID VARCHAR(4000),"+
			            "CASE_NAME VARCHAR(4000),"+
			            "CASE_NUMBER VARCHAR(4000),"+
			            "CASE_SOURCE VARCHAR(4000),"+
			            "CASE_STEP VARCHAR(4000) DEFAULT '信息登记',"+
			            "NEXT_CASE_STEP VARCHAR(4000),"+
			            "REQUIRED VARCHAR(10) NOT NULL,"+ //必要环节；0否、1是
			            "CCERT_ID VARCHAR(20),"+
			            "CERTIFICATE_ID_1 VARCHAR(20),"+
			            "CERTIFICATE_ID_2 VARCHAR(20),"+
			            "CLWGJYCS BIGINT(11)," +
			            "CYRYWGJYCS BIGINT(11)," +
			            "EXECUTION_TYPE VARCHAR(20),"+
			            "FILLING_DATE DATETIME," +
			            "FILLING_PLACE VARCHAR(4000),"+
			            "ILLEGAL_FACTS VARCHAR(4000),"+
			            "ILLEGAL_LAW VARCHAR(4000),"+
			            "ILLEGAL_TYPE_CODE VARCHAR(4000),"+
			            "CASECAUSEID VARCHAR(4000),"+
			            "CASECAUSENUMBER VARCHAR(4000),"+
			            "DISCRETIONID VARCHAR(4000),"+
			            "JYLB VARCHAR(4000),"+
			            "ORGAN_ADDRESS VARCHAR(4000),"+
			            "ORGAN_CONTACTOR VARCHAR(4000),"+
			            "ORGAN_NAME VARCHAR(4000),"+
			            "ORGAN_TEL VARCHAR(255),"+
			            "ORGAN_ZIPCODE VARCHAR(4000),"+
			            "PARTY VARCHAR(4000),"+
			            "PARTY_ADDRESS VARCHAR(4000),"+
			            "PARTY_AGE VARCHAR(255),"+
			            "PARTY_ECERTID VARCHAR(255),"+
			            "PARTY_ID_NO VARCHAR(255)  NOT NULL,"+
			            "PARTY_MANAGER VARCHAR(255),"+
			            "PARTY_SEX VARCHAR(255),"+
			            "PARTY_TEL VARCHAR(255),"+
			            "PARTY_TYPE VARCHAR(255),"+
			            "PARTY_UNIT_POSITION VARCHAR(4000),"+
			            "PARTY_ZIPCODE VARCHAR(255),"+
			            "PUNISH_AMOUNT VARCHAR(255),"+
			            "PUNISH_LAW VARCHAR(4000),"+
			            "REG_SYSTEM VARCHAR(255),"+
			            "SERIOUS_LEVEL VARCHAR(255),"+
			            "SHIP_CHECK_TON BIGINT(20)," +
			            "SHIP_NAME VARCHAR(4000),"+
			            "STAFF_1 VARCHAR(255),"+
			            "STAFF_2 VARCHAR(255),"+
			            "STEP_TIME VARCHAR(20)," +
			            "VEHICLE_AXLES_NUMBER BIGINT(11),"+
			            "VEHICLE_CHECK_TON BIGINT(20),"+
			            "VEHICLE_GOODS_NAME VARCHAR(255),"+
			            "VEHICLE_ID_COLOR VARCHAR(255),"+
			            "VEHICLE_SHIP_ID VARCHAR(255),"+
			            "VEHICLE_SHIP_TYPE VARCHAR(255),"+
			            "VEHICLE_TOTAL_WEIGHT BIGINT(20),"+
			            "VEHICLE_LENGTH VARCHAR(255),"+
			            "VEHICLE_WIDTH VARCHAR(255),"+
			            "VEHICLE_HEIGHT VARCHAR(255),"+
			            "VEHICLE_REGISTER VARCHAR(255),"+
			            "ZFML VARCHAR(255),"+
			            "ZFMLID VARCHAR(255),"+
			            "ZIPAREA VARCHAR(255),"+
			            "DEPART_ID VARCHAR(100),"+
			            "DEPART_NAME VARCHAR(4000),"+
			            "ORGAN_ID VARCHAR(100),"+
			            "CASE_TYPE VARCHAR(100),"+
			            "PUNISH_TPYE VARCHAR(100),"+
			            "ISONLINE VARCHAR(100) DEFAULT '离线'"+
			            ")", 
			            [], 
			            function(tx,result){ 
			            	if(typeof(callback)=='function'){
			            		callback();
			            	}
			            }, 
			            function(tx,error){
			            	pMessage('创建案件登记表失败'); 
			            }
				);
		    }
		);
	}
}

/**
 * 创建案件登记处理表
 * @param callback
 */
function createPonCaseBasicInfoCl(callback){
	if(pdb){
		pdb.transaction(
			function(tx) {
			    tx.executeSql(
			            "CREATE TABLE IF NOT EXISTS CASE_BASICINFOCL(" +
			            "CASE_BASICINFOCL_ID INTEGER primary key AutoIncrement," +
			            "CASE_BASICINFO_ID INTEGER NOT NULL," +     //案件ID
			            "FILLING_DATE VARCHAR(20)," +              //立案时间
			            "CASE_NAME VARCHAR(4000) NOT NULL,"+        //案由
			            "CASE_NUMBER VARCHAR(4000) NOT NULL,"+      //案件编号
			            "CASE_STEP VARCHAR(255) NOT NULL DEFAULT '信息登记',"+ //案件环节
			            "NEXT_CASE_STEP VARCHAR(255) NOT NULL,"+ //案件环节
			            "REQUIRED VARCHAR(10) NOT NULL,"+ //必要环节；0否、1是
			            "CREATE_ID VARCHAR(100) NOT NULL," +         //创建人ID
			            "CREATE_NAME VARCHAR(255) NOT NULL," +     //创建人姓名
			            "CREATE_TIME DATETIME  NOT NULL," +      //创建时间
			            "STAFF_1 VARCHAR(255) NOT NULL,"+          //执法人员1
			            "STAFF_2 VARCHAR(255) NOT NULL,"+          //执法人员2
			            "ISONLINE VARCHAR(100) DEFAULT '离线'"+     //在线、离线状态
			            ")", 
			            [], 
			            function(tx,result){ 
			            	if(typeof(callback)=='function'){
			            		callback();
			            	}
			            }, 
			            function(tx,error){
			            	pMessage('创建案件登记处理表失败'+error.message); 
			            }
				);
		    }
		);
	}
}